﻿#include "gridwindow.h"
#include <QGridLayout>
#include <QPushButton>
GridWindow::GridWindow(QWidget *parent) : QWidget(parent)
{
    initWindow();
}

void GridWindow::initWindow()
{
    QGridLayout * mainLayout = new QGridLayout(this);

    //    mainLayout->addWidget(new QPushButton,0,0,1,2);
    //    mainLayout->addWidget(new QPushButton,0,1);
    mainLayout->addWidget(new QPushButton,0,0);
    QPushButton *btn = new QPushButton ;
    mainLayout->addWidget(btn,0,1,2,1);
//    mainLayout->addWidget(btn,1,0);
    //改变组件的延展性
    btn->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    mainLayout->addWidget(new QPushButton,1,0);

}
